package cn.cjlmonster.demo02.utils;

import android.content.Context;
import android.util.TypedValue;

/**
 * This project is Demo02
 * Created by cjl on 2021/11/7 5:26 下午.
 */

public class DpUtils {

    public static int dpToPx(Context context, float dp) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());
    }
}
